/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * JFramePrincipal.java
 *
 * Created on 09/05/2013, 16:16:01
 */
package view;

import javax.swing.JOptionPane;
import javax.swing.GroupLayout.Alignment;
import javax.swing.GroupLayout;
import javax.swing.LayoutStyle.ComponentPlacement;
import javax.swing.JButton;
import java.awt.Font;
import java.awt.Color;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

/**
 *
 * @author tecnico
 */
public class JFramePrincipal extends javax.swing.JFrame {

    /** Creates new form JFramePrincipal */
    public JFramePrincipal() {
    	getContentPane().setBackground(Color.LIGHT_GRAY);
    	setBackground(Color.GREEN);
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        btnCadastrarUsuario = new javax.swing.JButton();
        jSeparator1 = new javax.swing.JSeparator();
        btnSair = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        setResizable(false);

        jLabel1.setFont(new java.awt.Font("Tahoma", 1, 36)); // NOI18N
        jLabel1.setText("SISTEMA HOTEL BOASVINDAS");

        btnCadastrarUsuario.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
        btnCadastrarUsuario.setText("H\u00F3spede");
        btnCadastrarUsuario.setActionCommand("cadastrarUsuario");
        btnCadastrarUsuario.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnCadastrarUsuarioActionPerformed(evt);
            }
        });

        btnSair.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
        btnSair.setText("Sair");
        btnSair.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnSairActionPerformed(evt);
            }
        });
        
        btnQuarto = new JButton("Quarto");
        btnQuarto.addActionListener(new ActionListener() {
        	public void actionPerformed(ActionEvent arg0) {
        		FrmSelecionaQuarto frmQuarto = new FrmSelecionaQuarto();
        		frmQuarto.setVisible(true);
        	}
        });
        btnQuarto.setFont(new Font("Tahoma", Font.PLAIN, 18));
        
        btnReserva = new JButton("Reserva");
        btnReserva.addActionListener(new ActionListener() {
        	public void actionPerformed(ActionEvent arg0) {
        		FrmReservaQuarto frmReserva = new FrmReservaQuarto();
        		frmReserva.setVisible(true);
        	}
        });
        btnReserva.setFont(new Font("Tahoma", Font.PLAIN, 18));
        
        btnAluguel = new JButton("Aluguel");
        btnAluguel.addActionListener(new ActionListener() {
        	public void actionPerformed(ActionEvent arg0) {
        		FrmSelecionaAluguel frmAluguel = new FrmSelecionaAluguel();
        		frmAluguel.setVisible(true);
        	}
        });
        btnAluguel.setFont(new Font("Tahoma", Font.PLAIN, 18));

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1Layout.setHorizontalGroup(
        	jPanel1Layout.createParallelGroup(Alignment.TRAILING)
        		.addGroup(jPanel1Layout.createSequentialGroup()
        			.addContainerGap()
        			.addComponent(jLabel1, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        			.addContainerGap())
        		.addComponent(jSeparator1, GroupLayout.DEFAULT_SIZE, 572, Short.MAX_VALUE)
        		.addGroup(jPanel1Layout.createSequentialGroup()
        			.addContainerGap()
        			.addComponent(btnCadastrarUsuario, GroupLayout.PREFERRED_SIZE, 131, GroupLayout.PREFERRED_SIZE)
        			.addPreferredGap(ComponentPlacement.RELATED)
        			.addComponent(btnAluguel, GroupLayout.PREFERRED_SIZE, 151, GroupLayout.PREFERRED_SIZE)
        			.addGap(5)
        			.addComponent(btnQuarto, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        			.addPreferredGap(ComponentPlacement.RELATED)
        			.addComponent(btnReserva, GroupLayout.PREFERRED_SIZE, 146, GroupLayout.PREFERRED_SIZE))
        		.addGroup(jPanel1Layout.createSequentialGroup()
        			.addContainerGap()
        			.addComponent(btnSair, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
        	jPanel1Layout.createParallelGroup(Alignment.LEADING)
        		.addGroup(jPanel1Layout.createSequentialGroup()
        			.addContainerGap()
        			.addComponent(jLabel1, GroupLayout.PREFERRED_SIZE, 57, GroupLayout.PREFERRED_SIZE)
        			.addPreferredGap(ComponentPlacement.RELATED)
        			.addComponent(jSeparator1, GroupLayout.PREFERRED_SIZE, 10, GroupLayout.PREFERRED_SIZE)
        			.addPreferredGap(ComponentPlacement.RELATED)
        			.addGroup(jPanel1Layout.createParallelGroup(Alignment.LEADING)
        				.addComponent(btnAluguel, GroupLayout.DEFAULT_SIZE, 42, Short.MAX_VALUE)
        				.addComponent(btnCadastrarUsuario, GroupLayout.DEFAULT_SIZE, 42, Short.MAX_VALUE)
        				.addComponent(btnReserva, GroupLayout.DEFAULT_SIZE, 42, Short.MAX_VALUE)
        				.addComponent(btnQuarto, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        			.addPreferredGap(ComponentPlacement.RELATED)
        			.addComponent(btnSair, GroupLayout.PREFERRED_SIZE, 42, GroupLayout.PREFERRED_SIZE)
        			.addContainerGap())
        );
        jPanel1.setLayout(jPanel1Layout);

        btnCadastrarUsuario.getAccessibleContext().setAccessibleName("btnCadastrarUsuario");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void btnCadastrarUsuarioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCadastrarUsuarioActionPerformed
    	FrmSelecionaHospede janelaHospede = new FrmSelecionaHospede();
        janelaHospede.setVisible(true);
    }//GEN-LAST:event_btnCadastrarUsuarioActionPerformed

    private void btnSairActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSairActionPerformed
        int x = JOptionPane.showConfirmDialog(null, "Deseja Sair?", "Sair", JOptionPane.YES_NO_OPTION);
        if (x == JOptionPane.YES_NO_OPTION) {
            System.exit(0);
        }
    }//GEN-LAST:event_btnSairActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run()
            {
            	JFramePrincipal janela= new JFramePrincipal();
            	janela.setVisible(true);
            }
        });
    }
    private javax.swing.JButton btnCadastrarUsuario;
    private javax.swing.JButton btnSair;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JSeparator jSeparator1;
    private JButton btnQuarto;
    private JButton btnReserva;
    private JButton btnAluguel;
    // End of variables declaration//GEN-END:variables
}
